-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use XSD to lint tools and repositories. #130
Conversation
- Implement validation abstraction that will use either lxml (Python lib) or xmllint (command line app) dependending on what is available - with test cases. - Add a ``--xsd`` flag to the lint command that lints against the experimental XSD from https://github.com/JeanFred/Galaxy-XSD. - Implement ``repository_dependencies.xsd`` to describe Tool Shed ``repository_dependencies.xml`` files (fairly complete). - Implement ``tool_dependencies.xsd`` to describe Tool Shed ``tool_dependencies.xml`` files. - Validates attributes and elements down to the ``action`` elements and then largely gives up (sticking ``any`` and ``anyAttribute`` tags on that element). - Registers everything in tools-devteam as valid, and detects one invalid XML file in tools-iuc. - Implement new ``shed_lint`` command that: - Validates tool_dependencies.xml against schema - Validates repository_dependencies.xml against schema - Bare minimum to lint .shed.yml files. - Optionally also lints tools in repsitories with the ``--tools`` argument. - Can recursively lint many repositories at ont time ``-r``. - Refactoring of existing stuff to support this and make room for XSD validation of tool XML files and generalizing applying actions over many repositories and many tools.
@@ -192,6 +194,24 @@ def build_tarball(tool_path): | |||
return temp_path | |||
|
|||
|
|||
def walk_repositories(path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, nice, will reuse this in recursive shed uploads.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is where I got it, it has already be refactored out of shed_upload
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, excellent, thanks!
fre. 17. apr. 2015 kl. 09.51 skrev John Chilton notifications@github.com:
In planemo/shed.py
#130 (comment):@@ -192,6 +194,24 @@ def build_tarball(tool_path):
return temp_path+def walk_repositories(path):
That is where I got it, it has already be refactored out of shed_upload.
—
Reply to this email directly or view it on GitHub
https://github.com/galaxyproject/planemo/pull/130/files#r28600556.
This is looking great. Very useful. |
lint_ctx.warn("Failed to parse .shed.yml file [%s]" % str(e)) | ||
|
||
warned = False | ||
for required_key in ["owner", "name"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason for not using the expanded key set? You might add description
, as that's the only other thing that's strictly required for a create-repo to succeed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is required for creation, but not for vanilla upload
- even these two fields are not strictly required... hmm.... I am not against requiring everything in .shed.yml
but this was a conservative first attempt.
@@ -0,0 +1,15 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not using submodules?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know how much fun copy and pasting scripted import of files from other projects is ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... maybe... pypa/pip#577 ... yeah I should do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done - thanks for the suggestion.
+1 from me, can't wait to add this to the jenkins testing bot! :D |
Use XSD to lint tools and repositories.
--xsd
flag to thelint
command (for tools) that lints against the experimental XSD from https://github.com/JeanFred/Galaxy-XSD.repository_dependencies.xsd
to describe Tool Shedrepository_dependencies.xml
files (fairly complete).tool_dependencies.xsd
to describe Tool Shedtool_dependencies.xml
files.action
elements and then largely gives up (stickingany
andanyAttribute
tags on that element).shed_lint
command that:tool_dependencies.xml
against schemarepository_dependencies.xml
against schema.shed.yml
files.--tools
argument. Likeshed_upload
uses presence of.shed.yml
to detect repositories, this should be generalized.-r
.